package dto

import "usbipproxy/common"

const (
	CodeOK = 0

	//attach
	CodeBusIdNotExist            = 1
	CodeAttachBusIdHasBeAttachEd = 2

	CodeBusIdNotExistDesc            = "can not attach to this device"
	CodeAttachBusIdHasBeAttachEdDesc = "has been attached"

	//detach

)

type UsbIpListReq struct {
	//Cmd   string         `form:"cmd" json:"cmd" binding:"required"`
	//Param map[string]any `form:"param" json:"param" binding:"required"`
}

type UsbIpListRspDataItem struct {
	BusId      string             `json:"bus_id"`
	VendorId   string             `json:"vendor_id"`
	Vendor     string             `json:"vendor"`
	Product    string             `json:"product"`
	Status     common.UsbIpStatus `json:"status"`
	DispatchId string             `json:"dispatch_id"`
	ConnId     int64              `json:"conn_id"`
	SessId     string             `json:"sess_id"`
}

type UsbIpListRspData struct {
	List []UsbIpListRspDataItem `json:"list"`
}

type UsbIpListRsp struct {
	Code int              `json:"code"`
	Msg  string           `json:"msg"`
	Data UsbIpListRspData `json:"data"`
}

type UsbIpAttachReq struct {
	BusId      string `form:"bus_id" json:"bus_id" binding:"required"`
	DispatchId string `form:"dispatch_id" json:"dispatch_id" binding:"required"`
	//Param map[string]any `form:"param" json:"param" binding:"required"`
}

type UsbIpAttachRsp struct {
	Code int            `json:"code"`
	Msg  string         `json:"msg"`
	Data map[string]any `json:"data"`
}

type UsbIpDetachReq struct {
	BusId      string `form:"bus_id" json:"bus_id" binding:"required"`
	DispatchId string `form:"dispatch_id" json:"dispatch_id" binding:"required"`
}

type UsbIpDetachRsp struct {
	Code int            `json:"code"`
	Msg  string         `json:"msg"`
	Data map[string]any `json:"data"`
}

type ClientInfoReq struct {
	DispatchId string `form:"dispatch_id" json:"dispatch_id" binding:"required"`
}

type ClientInfoRsp struct {
	Code int            `json:"code"`
	Msg  string         `json:"msg"`
	Data map[string]any `json:"data"`
}

type DispatchListReq struct {
	DispatchId string `form:"dispatch_id" json:"dispatch_id"`
}

type DispatchListRsp struct {
	Code int            `json:"code"`
	Msg  string         `json:"msg"`
	Data map[string]any `json:"data"`
}

type UsbipUnbindReq struct {
	BusId string `form:"bus_id" json:"bus_id"`
}

type UsbipUnbindRsp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	//Data map[string]any `json:"data"`
}

type DeviceInfoReq struct {
	BusId string `form:"bus_id" json:"bus_id"`
}

type DeviceInfoRsp struct {
	Code int            `json:"code"`
	Msg  string         `json:"msg"`
	Data map[string]any `json:"data"`
}

type ClientStopReq struct {
	DispatchId string `form:"dispatch_id" json:"dispatch_id" binding:"required"`
	Sid        int32  `form:"sid" json:"sid" binding:"required"`
}

type ClientStopRsp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}
